//
//  LSZGoodsCollectionViewCell.m
//  JKFuYinProject
//
//  Created by 九酷 on 2018/6/13.
//  Copyright © 2018年 LC. All rights reserved.
//

#import "LSZGoodsCollectionViewCell.h"

@implementation LSZGoodsCollectionViewCell
-(id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.layer.masksToBounds = NO;
        //设置阴影的高度
        self.layer.shadowOffset = CGSizeMake(0, 1.2);
        //设置透明度
        self.layer.shadowOpacity = 0.2;
        self.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.bounds].CGPath;
        // 设置圆角大小
        self.layer.cornerRadius = 6.0;
        self.backgroundColor = [UIColor whiteColor];

        self.imageViewGoods = [[UIImageView alloc]init];
        [self.imageViewGoods.layer setMasksToBounds:YES];
        [self.imageViewGoods.layer setCornerRadius:6.0];
        [self addSubview:self.imageViewGoods];

        self.labelTitle = [[UILabel alloc]init];
        self.labelTitle.textColor = titleColorLSZ;
        [self addSubview:self.labelTitle];

        self.labelMoney = [[UILabel alloc]init];
//        self.labelMoney.textColor = [UIColor colorWithRed:140/255.0 green:140/255.0 blue:140/255.0 alpha:1];
        self.labelMoney.textColor = redUIColor;
        [self addSubview:self.labelMoney];

        [self.labelMoney mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.mas_left).offset(2);
            make.right.equalTo(self.mas_right);
            if (ScreenWidth == 320) {
                //5
                make.height.equalTo(@(14));
                self.labelMoney.font = FONT_(12.5);
            }else if(ScreenWidth == 375){
                // 6 7
                make.height.equalTo(@(16));
                self.labelMoney.font = FONT_(13);
            }else {
                //plus
                make.height.equalTo(@(18));
                self.labelMoney.font = FONT_(13.5);
            }
            make.bottom.equalTo(self.mas_bottom).offset(-5);
        }];
        [self.labelTitle mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.mas_left).offset(2);
            make.right.equalTo(self.mas_right);
            make.bottom.equalTo(self.labelMoney.mas_top).offset(-2);
            if (ScreenWidth == 320) {
                //5
                self.labelTitle.font = FONT_(13.5);
                make.height.equalTo(@(16));
            }else if(ScreenWidth == 375){
                // 6 7
                self.labelTitle.font = FONT_(14);
                make.height.equalTo(@(18));
            }else {
                //plus
                self.labelTitle.font = FONT_(14.5);
                make.height.equalTo(@(20));
            }
        }];
        [self.imageViewGoods mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self).offset(0);
            make.right.equalTo(self).offset(0);
            make.left.equalTo(self).offset(0);
            make.bottom.equalTo(self.labelTitle.mas_top).offset(-2);
        }];
    }
    return self;
}
@end
